<admintpl file="header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:U('Bdrunpeople/com_dispatch_list/')}">团队跑客管理</a></li>
        <li class="active"><a href="#')">团队跑客添加</a></li>
    </ul>

    <form  id="myform2" name="fileinfo" class="form-horizontal js-ajax-form" action="{:U('Bdrunpeople/com_dispatch_add')}" method="post" enctype="multipart/form-data" >

        <fieldset>
            <div class="control-group">
                <label class="control-label">所属团队:</label>
                <div class="controls">
                    <select  id="company_id"  name="company_id">
                        <option value="">==请选团队==</option>
                        <volist name="company_data" id="vo">
                            <option value="{$vo.company_id}">{$vo.company_name}</option>
                        </volist>
                    </select>
                </div>

                <input type="button"  class="btn btn-primary" value="增加" id="adddata" onClick="add_data_Div();" />
                <table id="div_data"  class="table table-hover table-bordered table-list" style="width: 40%">
                    <thead>
                    <tr>
                        <th >姓名</th>
                        <th >手机号</th>
             <!--           <th width="300">上传头像</th>-->
                        <!--           <th  >证件号码</th>-->
                        <!--           <th>运输工具</th> -->
                    </tr>
                    </thead>
                    <tbody>

                        <tr >
                            <td><input style="width: 150px;" name="data[1][dispatch_name]" type="text" value="{$vo.dispatch_name}" required/>
                            </td>
                            <td ><input  style="width: 150px;" name="data[1][mobile]" type="text" value="{$vo.mobile}" required/>
                            </td>
<!--
                            <td>
                                 <div style="text-align: center;">
                                    <input type="hidden" name="data[1][avatar]" id="avatar" value="">
                                    <a href="javascript:void(0);" onclick="flashupload('thumb_images', '附件上传','avatar',thumb_images,'1,jpg|jpeg|gif|png|bmp,1,,,1','','','');return false;">
                                        <img src="__TMPL__Public/assets/images/default-thumbnail.png" id="avatar_preview" width="35" style="cursor: hand" />
                                    </a>
                                    <input type="button" class="btn btn-small" onclick="$('#avatar_preview').attr('src','__TMPL__Public/assets/images/default-thumbnail.png');$('#avatar').val('');return false;" value="取消图片">
                                </div>
                            </td>

                            <td><input  style="width: 150px;" name="data[1][cert_number]" type="text" value="{$vo.cert_number}" required/>
                            </td>-->
<!--
                            <td><select  id="data[1][conveyance_id]"  name="data[1][conveyance_id]">
                                <volist name="conveyance_data" id="vo">
                                    <option value="{$vo.conveyance_id}">{$vo.conv_name}</option>
                                </volist>
                            </select>
                            </td> -->
                        </tr>
                    </tbody>

                    <div class="control-group">

                    </div>
                </table>
            </div>
        </fieldset>
        <input type="hidden" name="formget[is_accept_dispatch]" value="-1"/>
        <input type="hidden" name="formget[is_sign]" value="0"/>
        <input type="hidden" name="formget[company_id]" value="1"/>
        <div class="form-actions">
            <button type="submit" class="btn btn-primary js-ajax-submit">{:L('SAVE')}</button>
        </div>
    </form>
</div>
<script type="text/javascript" src="__PUBLIC__/js/ajaxfileupload.js"></script>
<script>

    var data_count = 2;
    function add_data_Div(){
        var div ="新增：<tr><td>"+
                "<input style=\"width: 150px;\"  name=\"data["+data_count+"][dispatch_name]\" type=\"text\" required/>"+
                "</td>"+
                "<td>"+
                "<input style=\"width: 150px;\" name=\"data["+data_count+"][mobile]\" type=\"text\" required/>"+
                "</td>"+
          /**      "<td>"+
                    "<div style=\"text-align: center;\">"+
                        "<input type=\"hidden\" name=\"data["+data_count+"][avatar]\" id=\"avatar"+data_count+"\" value=\"\">"+
                        "<a href=\"javascript:void(0);\" onclick=\"flashupload('thumb_images', '附件上传','avatar"+data_count+"\',thumb_images,'1,jpg|jpeg|gif|png|bmp,1,,,1','','','');return false;\">"+
                            "<img src=\"__TMPL__Public/assets/images/default-thumbnail.png\" id=\"avatar"+data_count+"_preview\" width=\"35\" style=\"cursor: hand\" />"+
                        "</a>"+
                        "<input type=\"button\" class=\"btn btn-small\" onclick=\"$('#avatar"+data_count+"_preview').attr('src','__TMPL__Public/assets/images/default-thumbnail.png');$('#avatar').val('');return false;\" value=\"取消图片\">"+
                    "</div>"+
                "</td>"+
                "<td>"+
                "<input style=\"width: 150px;\" name=\"data["+data_count+"][cert_number]\" type=\"text\"  required/>"+
                "</td>"+   **/
          /**      "<td>"+
                "<select  id=\"data["+data_count+"][conveyance_id]\"  name=\"data["+data_count+"][conveyance_id]\">"+
                    "<volist name='conveyance_data' id='vo'>"+
                        '<option value="{$vo.conveyance_id}">{$vo.conv_name}</option>'+
                    "</volist>"+
                "</select>"+
                "</td>"+   **/
                "</tr>";

        $('#div_data').append(div);
        data_count++;
    };


</script>
<script src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/content_addtop.js"></script>

</body>
</html>